/**
 * 文件名称:  Logger.java
 * 所属版权:  ChinaStar Technologies Co., Ltd. Copyright 2010-2021, All rights reserved
 * 简单描述:  <描述>
 * 修改作者:  xdli
 * 修改时间:  2012-6-20
 * 修改内容:  <修改内容>
 */
package com.chinastar.iweb.common.logger;

import java.io.Serializable;
import java.sql.SQLException;

import org.apache.log4j.Logger;

import com.chinastar.iweb.common.jdbc.DataType;
import com.chinastar.iweb.common.jdbc.ParameType;
import com.chinastar.iweb.common.jdbc.StarSupport;

/**
 * Logger
 *  
 * @author  xdli
 * @version 2012-6-20
 * @see     Logger
 * @since   1.0
 */
public class StarLogger implements Serializable
{

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 4890659216652739444L;
    
    public static final Logger _log = null;
    
    private StarSupport starSupport = null;
    
    public void save(StarLoggerBean starLoggerBean)
    {
        try
        {
            starSupport.setProcedure("p_changelog(:i_msglognum,:i_usernum,:i_ip,:i_message)");
            starSupport.addParame("i_msglognum", DataType.VARCHAR, starLoggerBean.getMsglognum(), ParameType.PARAME_IN);
            starSupport.addParame("i_usernum", DataType.VARCHAR, starLoggerBean.getUsernum(), ParameType.PARAME_IN);
            starSupport.addParame("i_ip", DataType.VARCHAR, starLoggerBean.getIp(), ParameType.PARAME_IN);
            starSupport.addParame("i_message", DataType.VARCHAR, starLoggerBean.getMessage(), ParameType.PARAME_IN);
            starSupport.execute();
        }
        catch (SQLException e)
        {
            e.printStackTrace();
        }
    }

    public StarSupport getStarSupport()
    {
        return starSupport;
    }

    public void setStarSupport(StarSupport starSupport)
    {
        this.starSupport = starSupport;
    }
    
}
